package cn.izeno.wx.models.component

/**
 * 微信第三方平台应用
 */
object ComponentApp {
  /** appid */
  lateinit var id: String
    @Synchronized get
    private set
  /** appsecret */
  lateinit var secret: String
    @Synchronized get
    private set
  /**
   * 用于接口验证的 messageToken
   */
  lateinit var messageToken: String
    @Synchronized get
    private set
  lateinit var aesKey: String
    @Synchronized get
    private set

  var accessToken: String = ""
    @Synchronized get
    @Synchronized set

  /** component_verify_ticket */
  var ticket: String = ""
    @Synchronized get
    @Synchronized set

  @Synchronized
  fun init(id: String, secret: String, token: String, aesKey: String) {
    this.id = id
    this.secret = secret
    this.messageToken = token
    this.aesKey = aesKey
  }
}